Development of a DC/DC converter for a LED system using Simulink
Copyright 2020 - 2020 The MathWorks, Inc.
Before starting
If you get warning such as this one:
do not panic! It simply means that you don't have the Hardware Support Package for TI C2000 installed. This package requires Embedded Coder and is available free of charge at this link You can still uses models and scripts for the simulation and tuning part - the configuration parameter for hardware implementation is set automatically to "None". If you want to generate code for a F28069 ControlCard, you need to install the Hardware Support Package.
Webinar recording link
Full version, 54 minutes:
Application description
This workflow reference covers the design, analysis, and software development for a Single Ended Primary Inductor Converter, commonly known as SEPIC, which is powered by a 12 Volt lithium-ion battery and is converting voltage to 18 Volt to power 36 LEDs divided in 6 module with each 6 LEDs in series. The developed software include a simplified BMS (battery management system) to watch over the battery status, supervisory logic to coordinate mode of operation and two closed-loop controllers (SEPIC voltage and LEDs current).
Software & Skills Requirements
This is an end-to-end workflow that encompass the role of multiple people. In reality, not everybody in a team would need all the toolboxes. Please contact your local MathWorks office to discuss and scope out toolchain needs.
To fully profit of this reference workflow you would need:
- Modeling and design environment: MATLAB, Simulink, Stateflow, Simscape, Simscape Electrical, Signal Processing Toolbox, DSP Systems Toolbox, Fixed-Point Designer
- Testing and tuning: Simulink Test, Control System Toolbox, Simulink Control Design, System Identification Toolbox
- Automatic Code Generation and Implementation: MATLAB Coder, Simulink Coder, Embedded Coder, Compatible C code compiler,Hardware support package for TI C2000 (free of charge at this link)
A prerequisite to fully profit from this reference workflow is to take following four onramps (starting from release R2020b):
The onramps are interactive, self-paced tutorial (around 2 hours length), but they are not to be considered formal training. It would be really beneficial to attend following (paid) trainings relevant to this topic:
Components
This project has been deveoped around a Texas instrument LED kit (codename: TMDSDCDCLEDKIT (link to online reference guide)). It uses a F28069 ControlCard.
The reference workflow doesn't need an hardware board for the majority of the discussed topics.
This application is interesting because:
- The SEPIC is using medium to high switching frequency (100 kHz)
- LEDs are current controlled using 20 kHz switching. Going from some LEDS working to only one or zero cause the SEPIC to go from CCM (continuous current mode) to DCM (discontinuous current mode)
- Filter design plays an important role in getting current and voltage signals as proper inputs to the controllers
System in action
You can see in the top left corner the hardware working. On the right top corner there is the model where we pressed once "deploy to hardware" to automatically generate code and load it unto the hardware kit.
Bottom left we see the current of the LEDs (which are powered on and off randomly) regulated to 60 mA. Bottom right corner the voltage is kept at 18 Volt, although you can see spikes when the LED change rapidly status.
Both controllers are PI controllers which were modeled, simulated tuned and verified within the Simulink platform. Because the converter was modeled appropriately, the PI parameters derived in simulation can be used directly on hardware with good results.
Workflow
This demo covers a typical power electronics development workflow, divided in 6 sections. Specific shortcuts based on these sections exist in the Project Shortcuts of the Simulink Project.